/********************************************************************************

    jMule - a Java massive parallel file sharing client

    Copyright (C) by the jMuleGroup ( see the CREDITS file )

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details ( see the LICENSE file ).

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

********************************************************************************/
package ants.p2p.utils.donkey;

/** FIXME: a class deserves a proper javadoc
 * @version $Revision: 1.20 $
 * <br>Last changed by $Author: emarant $ on $Date: 2003/12/17 23:26:07 $
 */
public interface DonkeyPacketConstants {
    // As it get a holding place for not only the packet constants, we should maybe change the name

    /** This is the max size of an donkey part covered by a hash.  */
    public final static long PARTSIZE = 0x947000; //9728000

    public final static int BLOCKSIZE = 0x2D000; /// 184320
    public final static int OP_EDONKEYHEADER = 0xE3;
    public final static int OP_EDONKEYPROT = OP_EDONKEYHEADER;
    public final static int OP_EXTENDEDPROT = 0xD4;
    public final static int OP_EMULEPROT = 0xC5;
    public final static int OP_MLDONKEYPROT = 0x00;
    public final static int MET_HEADER = 0x0E;

    /**The default donkey ports */
    // don't need this; uses any free port or the one specified by the system property // public final static short PORT_UDP = 4665; // Maybe We should have only one Base Port, and create all the other ports relative to the base ? So if PORT_LISTERNER would be the base, PORT_UDP = PORT_LISTENR-3; This way it would be easier for the enduser to change ports. ?
    public final static short PORT_LISTENER = 4668; // FixME: better name

    // client <-> server
    public final static int OP_LOGINREQUEST = 0x01;
    public final static int OP_SERVERMESSAGE = 0x38;
    public final static int OP_IDCHANGE = 0x40;
    public final static int OP_SERVERINFO = 0x41;
    public final static int OP_GETSERVERLIST = 0x14;	//client->server
    public final static int OP_OFFERFILES = 0x15;
    public final static int OP_SEARCHREQUEST = 0x16;
    public final static int OP_GETMORESEARCHRESULT = 0x21;
    public final static int OP_SERVERLIST = 0x32;		//server->client
    public final static int OP_SEARCHRESULT = 0x33;
    public final static int OP_GETSOURCES = 0x19;
    public final static int OP_FOUNDSOURCES = 0x42;
    public final static int OP_CALLBACKREQUEST = 0x1C;
    public final static int OP_SERVERSTATUS = 0x34;
    public final static int OP_CALLBACKREQUESTED = 0x35;
    public final static int OP_CALLBACKFAIL = 0x36;

    //client <-> UDP server
    public final static int OP_GLOBEXTENDEDSEARCHREQ = 0x92;
    public final static int OP_GLOBSERVERSTATUSREQ = 0x96; //client->server
    public final static int OP_GLOBSERVERSTATUS = 0x97;    //server->client
    public final static int OP_GLOBSEARCHREQ = 0x98;
    public final static int OP_GLOBSEARCHRES = 0x99;
    public final static int OP_GLOBGETSOURCES = 0x9A;
    public final static int OP_GLOBFOUNDSOURCES = 0x9B;
    public final static int OP_GLOBCALLBACKREQ = 0x9C;
    public final static int OP_GLOBCALLBACKFAIL = 0x9E;
    public final static int OP_GLOBSERVERINFOREQ =  0xa2;
    public final static int OP_GLOBSERVERINFO =  0xa3; //[name] (short)a stringbytes[a]     [description] (short)b stringbytes[b]

    // client <-> client
    public final static int OP_HELLO = 0x01;
    public final static int OP_HELLOANSWER = 0x4c;
    public final static int OP_SENDINGPART = 0x46;
    public final static int OP_REQUESTPARTS = 0x47;
    public final static int OP_FILEREQREGRET = 0x48;
    public final static int OP_ENDTRANSFER = 0x49;
    public final static int OP_FILELISTREQUEST = 0x4A;
    public final static int OP_FILELISTANSWER = 0x4B;
    public final static int OP_CALLBACKHINT = 0x4D;
    public final static int OP_MESSAGE = 0x4E;
    public final static int OP_SETREQFILEID = 0x4F;
    public final static int OP_FILESTATUS = 0x50;
    public final static int OP_HASHSETREQUEST = 0x51;
    public final static int OP_HASHSETANSWER = 0x52;
    public final static int OP_STARTUPLOADREQ = 0x54;
    public final static int OP_ACCEPTUPLOADREQ = 0x55;
    public final static int OP_CANCELTRANSFER = 0x56;
    public final static int OP_UPLOADEND = 0x57;
    public final static int OP_FILEREQUEST = 0x58;
    public final static int OP_FILEREQANSWER = 0x59;
    public final static int OP_QUEUEPOSITION = 0x5C;

    public final static int SO_EDONKEY = 0;
    public final static int SO_OLDEMULE = 1;
    public final static int SO_EMULE = 2;
    public final static int SO_OLDMLDONKEY = 3;
    public final static int SO_MLDONKEY = 4;
    public final static int SO_HYBRID = 5;
    public final static int SO_OVERNET = 6;
}
